<?php
/**
 * Created by PhpStorm.
 * User: lee
 * Date: 2018/3/15
 * Time: 下午3:16
 */

namespace Biz\tools;

use Biz\module\Sys\ErrorConst as clsErrorConst;

class ThrowException{
    public static function main($errorCode, $errorMessage = ''){
        $msg = $errorMessage;

        if (empty($errorMessage)) {
            $msg = isset(clsErrorConst::$errorDesc[$errorCode])
                ? clsErrorConst::$errorDesc[$errorCode] : $msg;
        }

        throw new \Exception($msg, $errorCode);
    }
}